import { IsArray, IsEnum, IsNumber, IsOptional, IsString, Length } from 'class-validator';
import { PagingDto } from 'src/common/dto/index';

import { Transform, Type } from 'class-transformer';


export class ListAnnexDto extends PagingDto {
    @IsOptional()
    @IsString()
    @Length(0, 30)
    originalName?: string;

    @IsOptional()
    @IsString()
    type?: string;

    @IsOptional()
    @IsNumber()
    @Transform(({ value }) => {
        if (typeof value === 'string') {
            return Number(value);
        }
        return value;
    })
    createBy?: number;
}
